project(SimpleChat)

#-----------------------------------------------------------------------------
# Requires a recent version of CMake
cmake_minimum_required(VERSION 2.6)

set(BoostComponents date_time
  filesystem
  program_options
  regex
  serialization
  signals
  system
  thread
  unit_test_framework)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")

find_package(Boost COMPONENTS ${BoostComponents} REQUIRED)
find_package(Qt4 REQUIRED)

include_directories(SYSTEM ${Boost_INCLUDE_DIR})

INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})

SET(CMAKE_AUTOMOC ON)

include_directories ("${PROJECT_SOURCE_DIR}/libNetComm")
add_subdirectory (libNetComm)

include_directories ("${PROJECT_SOURCE_DIR}/libSimpleChatGUI")
add_subdirectory (libSimpleChatGUI)

target_link_libraries (#raytracer
   SimpleChatGUI
)

set(SRCs simplechat.cpp)
#QT4_WRAP_CPP(MOCs ${SRCs}) #SEULEMENT SUR LES HEADERS de class heritant de class QT

ADD_EXECUTABLE(simpleChat ${SRCs} ${MOCs})
TARGET_LINK_LIBRARIES(simpleChat ${QT_LIBRARIES} SimpleChatGUI NetComm)

ADD_EXECUTABLE(serverChat chatserver.cpp)
TARGET_LINK_LIBRARIES(serverChat NetComm)

ADD_EXECUTABLE(clientChat chatclient.cpp)
TARGET_LINK_LIBRARIES(clientChat NetComm
   pthread)

